﻿using Microsoft.Xna.Framework;

namespace Rescue_of_the_Dwarvenzombies.Constants
{
    /// <summary>
    /// 
    /// </summary>
    /// <remarks></remarks>
    public static class Constant
    {
        /* Enemies */

        /// <summary>
        /// The name of the texture matched with the Zombie class in the RenderManager
        /// </summary>
        public static string ZOMBIE_TEXTURE_NAME = "Graphics/Zombie";

        /// <summary>
        /// The probability for a potion being dropped by zombies.
        /// </summary>
        public static float ZOMBIE_DROPRATE = 20;
        public static float ZOMBIE_HEALTH = 100;
        public static float ZOMBIE_VELOCITY = 50;
        public static float ZOMBIE_DAMAGE = 150;
        public static float ZOMBIE_RATE_OF_FIRE = 0.25f;
        /// <summary>
        /// The score that's given from killing a zombie.
        /// </summary>
        public static int ZOMBIE_SCORE = 100;

        /// <summary>
        /// The rectangle width of the zombie sprite.
        /// </summary>
        public static int ZOMBIE_RECTANGLE_WIDTH = 35;

        /// <summary>
        /// The rectangle height of the zombie sprite.
        /// </summary>
        public static int ZOMBIE_RECTANGLE_HEIGHT = 57;

        /// <summary>
        /// The rectangle offset width of the zombie sprite used when animating.
        /// </summary>
        public static int ZOMBIE_RECTANGLE_OFFSET_X = 30;

        /// <summary>
        /// The rectangle offset height of the zombie sprite used when animating.
        /// </summary>
        public static int ZOMBIE_RECTANGLE_OFFSET_Y = 7;

        /// <summary>
        /// Zombie total texture width.
        /// </summary>
        public static int ZOMBIE_TOTAL_TEXTURE_WIDTH = 420;

        /// <summary>
        /// The number of zombie sprites in X axis.
        /// </summary>
        public static int ZOMBIE_ANIMATIONS_X = 7;

        /// <summary>
        /// The number of zombie sprites in Y axis.
        /// </summary>
        public static int ZOMBIE_ANIMATIONS_Y = 4;

        //Dwarves
        /// <summary>
        /// The name of the texture matched with the Dwarf class in the RenderManager
        /// </summary>
        public static string DWARF_TEXTURE_NAME = "Graphics/Dwarf";
        /// <summary>
        /// The rectangle width of the dwarf sprite.
        /// </summary>
        public static int DWARF_RECTANGLE_WIDTH = 35;
        /// <summary>
        /// The rectangle height of the dwarf sprite.
        /// </summary>
        public static int DWARF_RECTANGLE_HEIGHT = 45;
        /// <summary>
        /// The rectangle offset width of the dwarf sprite used when animating.
        /// </summary>
        public static int DWARF_RECTANGLE_OFFSET_X = 15;
        /// <summary>
        /// The rectangle offset height of the dwarf sprite used when animating.
        /// </summary>
        public static int DWARF_RECTANGLE_OFFSET_Y = 4;
        /// <summary>
        /// The total dwarf texture size.
        /// </summary>
        public static int DWARF_TOTAL_TEXTURE_WIDTH = 400;
        /// <summary>
        /// The number of zombie sprites in X axis.
        /// </summary>
        public static int DWARF_ANIMATIONS_X = 9;
        /// <summary>
        /// The number of zombie sprites in X axis.
        /// </summary>
        public static int DWARF_ANIMATIONS_Y = 4;

        public static int NR_OF_PLAYERS = 2;

        /// <summary>
        /// Time bar
        /// </summary>
        public static string TIMEBAR_TEXTURE_NAME = "Graphics/TimeBar";

        public static Vector2 TIMEBAR_POSITION = new Vector2(20, 20);

        public static float TIMEBAR_WIDTH = 400;

        public static float TIMEBAR_HEIGHT = 30;
        /// <summary>
        /// 
        /// </summary>
        public static float MAXTIME = 3600;

        public static float TIMEBAR_X_OFFSET = 0.02f;

        public static float TIMEBAR_Y_OFFSET = 0.02f;

        /// <summary>
        /// Weapons 
        /// </summary>
        public static string AXE_TEXTURE_NAME = "Graphics/Axe";
        public static int AXE_RECTANGLE_WIDTH = 16;
        public static int AXE_RECTANGLE_HEIGHT = 18;
        public static int AXE_RECTANGLE_OFFSET_X = 2;
        public static int AXE_RECTANGLE_OFFSET_Y = 0;
        public static int AXE_TOTAL_TEXTURE_WIDTH = 68;
        public static int AXE_ANIMATIONS_X = 4;
        public static int AXE_ANIMATIONS_Y = 4;

        /// <summary>
        /// Items
        /// </summary>
        public static string POTION_TEXTURE_NAME = "Graphics/Potion";
        public static int POTION_RECTANGLE_WIDTH = 14;
        public static int POTION_RECTANGLE_HEIGHT = 19;
        public static int POTION_RESTORE_POWER = 100;
        public static int POTION_DURATION = 10;

        /// <summary>
        /// Graphics
        /// </summary>
        public static int PREFERRED_BACKBUFFER_WIDTH = 1280;
        public static int PREFERRED_BACKBUFFER_HEIGHT = 720;

        /// <summary>
        /// Animation
        /// </summary>
        public static float ANIMATION_TIME = 75;
        /// <summary>
        /// Environment
        /// </summary>
        public static string GROUND_TEXTURE_NAME = "Graphics/Ground_Tile";
        public static string GROUND_SPAWN_TEXTURE_NAME = "Graphics/Ground_Spawn";
        public static int GROUND_WIDTH = 4000;
        public static int GROUND_HEIGHT = 720;
        
        /// <summary>
        /// Obstacles
        /// </summary>
        public static string WALL_TEXTURE_NAME = "Graphics/Wall";

        /// <summary>
        /// Depth of the layers used to sort them into drawing them in the right order
        /// </summary>
        public static float PLAYER_LAYER_DEPTH = 0.2f;
        public static float ENEMY_LAYER_DEPTH = 0;
        public static float OBSTACLE_LAYER_DEPTH = 0.8f;
        public static float ROOT_LAYER_DEPTH = 1;
        public static float ITEM_LAYER_DEPTH = 0.6f;
        public static float WEAPON_LAYER_DEPTH = 0.4f;

        /// <summary>
        /// Character actions
        /// </summary>
        /// <remarks></remarks>
        public enum Action
        {
            MoveUp,
            MoveDown,
            MoveLeft,
            MoveRight,
            MoveDownLeft,
            MoveDownRight,
            MoveUpLeft,
            MoveUpRight,
            Attack,
            DoNothing,
            Pause,
            Start,
            Die,
            TakeDamage
        }

        /// <summary>
        /// Character directions 
        /// </summary>
        /// <remarks></remarks>
        public enum Direction
        {
            Up,
            Down,
            Left,
            Right,
            DownLeft,
            DownRight,
            UpLeft,
            UpRight
        }

        /// <summary>
        /// Ocject names
        /// </summary>
        /// <remarks></remarks>
        public enum ObjectName
        {
            Dwarf,
            Zombie,
            Wall,
            Axe
        }

        /// <summary>
        /// Layer types 
        /// </summary>
        /// <remarks></remarks>
        public enum Layer
        {
            Root,
            Player,
            Weapon,
            Enemy,
            Item,
            Obstacle
        }

        /// <summary>
        /// Movement vectors
        /// </summary>
        /// <remarks></remarks>
        public struct Transitions
        {
            public static Vector2 MoveUp = new Vector2(0, -1);
            public static Vector2 MoveDown = new Vector2(0, 1);
            public static Vector2 MoveLeft = new Vector2(-1, 0);
            public static Vector2 MoveRight = new Vector2(1, 0);
            public static Vector2 MoveDownLeft = new Vector2(-0.75f, 0.75f);
            public static Vector2 MoveDownRight = new Vector2(0.75f, 0.75f);
            public static Vector2 MoveUpLeft = new Vector2(-0.75f, -0.75f);
            public static Vector2 MoveUpRight = new Vector2(0.75f, -0.75f);
            public static Vector2 DoNothing = new Vector2(0, 0);
        }
    }
}